package ycj.learn.springcloud.core.entities;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * 返回结果封装类
 */
@Data
@AllArgsConstructor
public class Res {

    private String msg;
    private int code;
    private Object data;

    public static Res success(Object data) {

        return new Res("success", 200, data);
    }

    public static Res error(String msg, int code, Object data) {

        return new Res(msg, code, data);
    }
}
